import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/index.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/Dashboard.vue'),
        meta: { title: '仪表盘', icon: 'Odometer' }
      }
    ]
  },
  {
    path: '/routes',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Routes',
        component: () => import('@/views/Routes.vue'),
        meta: { title: '路由管理', icon: 'Connection' }
      }
    ]
  },
  {
    path: '/templates',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Templates',
        component: () => import('@/views/Templates.vue'),
        meta: { title: '模板管理', icon: 'Document' }
      }
    ]
  },
                {
                path: '/logs',
                component: Layout,
                children: [
                  {
                    path: '',
                    name: 'Logs',
                    component: () => import('@/views/Logs.vue'),
                    meta: { title: '日志管理', icon: 'List' }
                  }
                ]
              },
              {
                path: '/events',
                component: Layout,
                children: [
                  {
                    path: '',
                    name: 'Events',
                    component: () => import('@/views/Events.vue'),
                    meta: { title: '事件管理', icon: 'Bell' }
                  }
                ]
              }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 